package org.game.porker.porker24.mybatis.service.impl;

//import javax.annotation.Resource;

import org.game.porker.porker24.mybatis.dao.DerbyDbSetupMapper;
import org.game.porker.porker24.mybatis.service.DerbyDbSetupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("derbyDbSetupService")
public class DerbyDbSetupServiceImpl implements DerbyDbSetupService {

	@Autowired
	private DerbyDbSetupMapper derbyDbSetupDao;
	
	public DerbyDbSetupServiceImpl() {
		// TODO Auto-generated constructor stub
	}
	

	/**
	 * name:数据库名称
	 * password:连接数据库密码
	 */
	public void setupDeryDb(String name, String password) {
		// TODO Auto-generated method stub
		derbyDbSetupDao.createSchema(name, password);
		derbyDbSetupDao.createTablePlayer();
		derbyDbSetupDao.createTableGame();
	}

}
